<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<?php

	require_once("../connectMysql/connetMysql.class.php");
	session_start();
	$UserPhone=$_SESSION['mb'];
	
	$db=new connetMysql;
	$con=$db->getConnect();
	$get_idsql="SELECT UserId FROM user WHERE UserPhone='".$UserPhone."'";
	
	$result=$con->query($get_idsql);
	$row = mysqli_fetch_assoc($result);
	$Userid=$row['UserId'];
	
	$title=$_POST['title'];
	$atime=$_POST['atime'];
	$atype=$_POST['atype'];
	$acharge=(int)$_POST['acharge'];
	$psum=(int)$_POST['psum'];
	$prov=$_POST['prov'];
	$city=$_POST['city'];
	$address=$_POST['address'];
	$intro=$_POST['intro'];
	date_default_timezone_set('PRC');
    $ActPublishTime=date("Y-m-d h:i:s");	
	
		$sql = "INSERT INTO activity(UserId,ActPublish,ActStart,ActProv,ActCity,ActAddress,ActDescri,ActContent,ActType,ActLimitNum,ActCharge) 				VALUES('".$Userid."','".$ActPublishTime."','".$atime."','".$prov."','".$city."','".$address."','".$title."','".$intro."','".$atype."','".$psum."','".$acharge."')";
		
		
		$result = mysqli_query($con,$sql);
		echo "<script>alert('发布成功！');</script>";
		$con->close(); 
		header('Location: activity.php');
		
	
?>